import request from "./request";


// 如果 不了解 axios 的内部原理，就只需要知道 res 是什么，取决于 请求的函数的返回的类型 Promise<服务器返回的类型>
export const LoginApi = (params: ILoginParams): RSP<string> => request.post('/1024/login', params)
// 注册数据接口
export const RegisterApi = (params: any): RSP<boolean> => request.post('/1024/register', params)

// 获取首页数据的接口
export const getHomePageDataApi = (): RSP<IHomeData> => request.get('/6666')

export const getQuestionTypeApi = (actionCode: string): RSP<IQuestionType[]> => request.get(`/1314/${actionCode}/all`)

export const getPraticeListApi = (params: IPracticeParams): RSP<IPracticeItem[]> => request.post('/1314', params)

// 提交答案
export const submitUserAnswerAip = (params: ISubmitParams): RSP<any> => request.put('/1314', params)

export const getSubjectsApi = (): RSP<ISubjects[]> => request.get('/6666/field')